<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
     <head>
     <link href="{{ STATIC_URL }}img/favicon.png" rel="icon" type="image/x-icon" />
     <link href="{{ STATIC_URL }}css/jquery-ui/jquery-ui.min.css" rel="stylesheet" type="text/css" media="screen"/>
     <link href="{{ STATIC_URL }}css/mdm.css" rel="stylesheet" type="text/css" media="screen"/>
     <script type="text/javascript" src="{{ STATIC_URL }}js/jquery/jquery-1.11.1.min.js"></script>
     <script type="text/javascript" src="{{ STATIC_URL }}js/jquery/jquery-ui.min.js"></script>
     <title>Bravo, viviendas diferentes</title>    
     </head>
<body>

     <a href="{% url "index" %}" title="Bravo, viviendas diferentes. Inicio"><img src="{{ STATIC_URL }}img/bravoc.png"/></a>
     <div id="frm" title="Introduce tus datos">
          <form id="formulario" method="post" action="{% url "django.contrib.auth.views.login" %}">
          {% csrf_token %} 
          <table id="form">
          <tr>
              <td>{{ form.username.label_tag }}</td>
              <td>{{ form.username }}</td>
          </tr>
          <tr>
              <td>{{ form.password.label_tag }}</td>
              <td>{{ form.password }}</td>
          </tr>
          <tr>
               <td colspan="2">
                         {% if form.errors %}
                         <p class="error">El usuario y/o contrase&ntilde;a que ha introducido no coinciden con los que tenemos registrados. Por favor, int&eacute;ntelo de nuevo.</p>
                         {% endif %}
               </td>
          </tr>
          </table>
          <input type="hidden" name="next" value="{{ next }}" />
          </form>
     </div>

     <script>
          // El diálogo 
          $("#frm").dialog({
               bgiframe: true,
               autoOpen: true,
               height: 'auto',
               minHeight: 200,
               width: 400,
               position: { my: "top-250" },
               modal: false,
               resizable: false,
               draggable: false,
               closeOnEscape: false,
               open: function(event, ui) { $(".ui-dialog-titlebar-close").hide() },
               buttons: {
                    'Aceptar': function() {
                         $('#formulario').submit()
                    },
               }

          })
     </script>
     </body> 
</html>